package Day30;

public class HomeWork1 {

    public static void main(String[] args) {

        System.out.println(Work.getNextNum());
        System.out.println(Work.getNextNum());
        Work w1 = new Work(0);
        Work w2 = new Work(1);
        Work w3 = new Work(2);
        System.out.println(w1.serial);
        System.out.println(w2.serial);
        System.out.println(w3.serial);
    }
}

class Work{
    private static int currentNum = 100000;
    public int serial;
    public int getSerial(){
        return serial;
    }
    public static int getNextNum(){
        currentNum += 100;
        return currentNum;
    }

    public Work(int serial) {
        this.serial = getNextNum();
    }
}
